package cn.linjianhui.flink.sample.web.dao.SqlProvider;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.jdbc.SQL;
import java.util.List;

public class WareSqlProvider {
    public String listWare(@Param(value = "wareSkuCodes")List<String> wareSkuCodes) {
        return new SQL() {{
            SELECT("ware_code as wareCode, ware_name as wareName, model as model, unit_name as unitName, manufacturer_name as manufacturerName, ware_pic as warePic ");
            FROM("ware");
            WHERE("ware_code in ('" + String.join("','", wareSkuCodes) + "')");
        }}.toString();
    }

    public String listWareBrand(@Param(value = "brandCodes")List<String> brandCodes) {
        return new SQL() {{
            SELECT("BRANDCODE as brandCode, BRANDNAME as brandName");
            FROM("BASE.WI_WAREBRAND");
            WHERE("BRANDCODE in ('" + String.join("','", brandCodes) + "')");
        }}.toString();
    }
}
